<?php


namespace app\controller\v1;


use app\model\CommodityCate;
use app\model\CommodityGoods;
use think\Request;

/**
 * 商品
 * Class Goods
 * @package app\controller\v1
 */
class Goods
{


    /**
     * 分类列表
     * @param CommodityCate $commodityCate
     * @param Request $request
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function CateList(CommodityCate $commodityCate, Request $request)
    {
        return $commodityCate->CateList();
    }


    /**
     * 商品列表
     * @param CommodityGoods $commodityGoods
     * @param Request $request
     * @return mixed
     * @throws \think\db\exception\DbException
     */
    public function GoodsList(CommodityGoods $commodityGoods, Request $request)
    {
        return $commodityGoods->GoodsList($request->data);
    }


    /**
     * 专区商品列表
     * @param CommodityGoods $commodityGoods
     * @param Request $request
     * @return mixed
     * @throws \think\db\exception\DbException
     */
    public function SpecialGoodsList(CommodityGoods $commodityGoods, Request $request)
    {
        return $commodityGoods->SpecialGoodsList($request->data);
    }


    /**
     * 秒杀商品列表
     * @param CommodityGoods $commodityGoods
     * @param Request $request
     * @return mixed
     * @throws \think\db\exception\DbException
     */
    public function SpikeList(CommodityGoods $commodityGoods, Request $request)
    {
        return $commodityGoods->SpikeList($request->data);
    }


    /**
     * 商品详情
     * @param CommodityGoods $commodityGoods
     * @param Request $request
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function GoodsDetails(CommodityGoods $commodityGoods, Request $request)
    {
        return $commodityGoods->GoodsDetails($request->data, $request->goods);
    }


    /**
     * 抽奖专区图片
     * @param CommodityGoods $commodityGoods
     * @param Request $request
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function LotteryImages(CommodityGoods $commodityGoods, Request $request)
    {
        return $commodityGoods->LotteryImages($request->data);
    }

}